function PS(element) {
    var doc = element.ownerDocument;
    var pos = {"left": 0, "top": 0};
    var box;
    if (element.getBoundingClientRect) {
        box = element.getBoundingClientRect();
        pos.left = Math.floor(box.left) + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft);
        pos.top = Math.floor(box.top) + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop);
        pos.left -= doc.documentElement.clientLeft;
        pos.top -= doc.documentElement.clientTop
    }
    return pos
}
var atime, bkey, acIV = '';
$ = function (id) {
    return "string" == typeof id ? document.getElementById(id) : id
};
function rmClass(o, n) {
    o.className = o.className.replace(n, '')
};function addClass(o, n) {
    if (o != undefined)o.className += ' ' + n
};function hide(o) {
    o.style.display = 'none'
};function show(o) {
    o.style.display = 'block'
};var acBind = function (object, fun) {
    return function () {
        return fun.apply(object, arguments)
    }
};
function AC(o, aO, t) {
    this.o = $(o);
    this.aO = $(aO);
    this.s = t;
    this.index = -1;
    this.sV = ""
}
var flag = null;
AC.prototype = {
    init: function () {
        if (document.all) {
            p = PS(this.o);
            l = p.left;
            t = p.top + this.o.offsetHeight;
        } else {
            l = this.o.offsetLeft;
            t = this.o.offsetTop + this.o.offsetHeight;
        }
        this.aO.style.left = l + "px";
        this.aO.style.top = t + "px";
        this.aO.style.width = this.o.offsetWidth - 2 + "px"
    }, hide: function () {
        while (this.aO.hasChildNodes()) {
            this.aO.removeChild(this.aO.firstChild)
        }
        this.aO.className = "auto_hidden"
    }, setValue: function (_t) {
        return function () {
            _t.o.value = this.seq;
            _t.aO.className = "auto_hidden";
            document.forms['f'][0].submit()
        }
    }, msover: function (_t, _d) {
        return function () {
            _t.index = _d;
            var length = _t.aO.children.length;
            for (var j = 0; j < length; j++) {
                if (j != _t.index) {
                    _t.aO.childNodes[j].className = 'auto_onmouseout';
                } else {
                    _t.aO.childNodes[j].className = 'auto_onmouseover'
                }
            }
        }
    }, cClass: function (l) {
        for (var i = 0; i < l; i++) {
            if (i != this.index) {
                this.aO.childNodes[i].className = 'auto_onmouseout'
            } else {
                this.aO.childNodes[i].className = 'auto_onmouseover';
                this.o.value = this.aO.childNodes[i].seq
            }
        }
    }, pressKey: function (kc) {
        var length = this.aO.children.length;
        if (kc == 40) {
            ++this.index;
            if (this.index > length) {
                this.index = 0
            } else if (this.index == length) {
                this.o.value = this.sV
            }
            this.cClass(length)
        } else if (kc == 38) {
            this.index--;
            if (this.index < -1) {
                this.index = length - 1
            } else if (this.index == -1) {
                this.o.value = this.sV
            }
            this.cClass(length)
        } else if (kc == 13) {
            this.aO.className = "auto_hidden";
            this.index = -1
        } else {
            this.index = -1
        }
    }, start: function (event) {
        clearInterval(flag);
        var kc = event.keyCode;
        flag = setTimeout(function () {
            ac.reals(kc);
        }, 150);
    }, reals: function (kc) {
        window.clearTimeout(flag);
        if (kc != 13 && kc != 38 && kc != 40) {
            this.init();
            this.hide();
            this.sV = this.o.value;
            if (this.o.value.replace(/(^\s*)|(\s*$)/g, '') == "") {
                return;
            }
            acIV = this.o.value;
            if (this.s == 'taobao')acLoadJS("http://suggest.taobao.com/sug?code=utf-8&callback=acCalla&q=" + encodeURIComponent(this.o.value) + "&t=" + Math.random()); else acLoadJS("http://suggestion.baidu.com/su?wd=" + encodeURIComponent(this.o.value) + "&ie=utf-8&cb=acCallb&t=" + Math.random())
        }
        this.pressKey(kc);
        window.onresize = acBind(this, function () {
            this.init();
        });
    }
};
function acShow(a) {
    try {
        var reg = new RegExp("(" + acIV + ")", "i")
    } catch (e) {
        return;
    }
    ac.aO.innerHTML = '';
    var div_index = 0;
    for (var i = 0; i < a.length; i++) {
        if (typeof a[i] == 'string') {
            w = a[i];
            n = ''
        } else {
            w = a[i][0];
            n = a[i][1]
        }
        if (reg.test(w)) {
            var div = document.createElement("div");
            div.className = "auto_onmouseout";
            div.seq = w;
            div.onclick = ac.setValue(ac);
            div.onmouseover = ac.msover(ac, div_index);
            if (n)div.innerHTML = '<li style="float:left">&nbsp;' + w.substr(0, acIV.length) + "<strong>" + w.substr(acIV.length) + "</strong>" + '</li><li style="float:right;color:green">' + n + '&#26465;&#32467;&#26524;</li><br/>'; else div.innerHTML = '<li style="float:left">&nbsp;' + w.substr(0, acIV.length) + "<strong>" + w.substr(acIV.length) + "</strong>" + '</li><br/>';
            ac.aO.appendChild(div);
            ac.aO.className = "auto_show";
            div_index++
        }
    }
};function acCalla(a) {
    acShow(a.result)
};function acCallb(a) {
    acShow(a.s)
};function acLoadJS(a, d) {
    var c = "tbsuggent", b = document.body.appendChild(document.createElement("script"));
    d = "utf-8" || d;
    b.language = "javascript";
    b.id = c;
    b.charset = d;
    b.src = a
}
var ac = new AC('kw', 'auto', 'baidu');
document.onclick = function () {
    ac.hide()
}
var XMLHttp = {
    _p: [], _i: function () {
        for (var i = 0; i < this._p.length; i++) {
            if (this._p[i].readyState == 0 || this._p[i].readyState == 4) {
                return this._p[i];
            }
        }
        this._p[this._p.length] = this._cO();
        return this._p[this._p.length - 1]
    }, _cO: function () {
        if (window.XMLHttpRequest) {
            var oX = new XMLHttpRequest()
        } else {
            var MSXML = ['MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP'];
            for (var n = 0; n < MSXML.length; n++) {
                try {
                    var oX = new ActiveXObject(MSXML[n]);
                    break;
                } catch (e) {
                }
            }
        }
        if (oX.readyState == null) {
            oX.readyState = 0;
            oX.addEventListener("load", function () {
                oX.readyState = 4;
                if (typeof oX.onreadystatechange == "function") {
                    oX.onreadystatechange();
                }
            }, false);
        }
        return oX;
    }, sendReq: function (method, u, data, cb) {
        var oX = this._i();
        with (oX) {
            try {
                if (u.indexOf("?") > 0) {
                    u += "&randnum=" + Math.random();
                } else {
                    u += "?randnum=" + Math.random()
                }
                open(method, u, true);
                setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8');
                send(data);
                onreadystatechange = function () {
                    if (oX.readyState == 4 && (oX.status == 200 || oX.status == 304)) {
                        cb(oX)
                    }
                }
            } catch (e) {
                alert(e)
            }
        }
    }
};
function send_request(u, cb, data) {
    if (typeof(data) == 'undefined') {
        method = 'get'
    } else {
        method = 'post'
    }
    XMLHttp.sendReq(method, u, data, cb)
}
var scache = new Array(), ccache = new Array(), stat = 1, timer = null;
var changeid = getCookie("changeid");
if (changeid) {
    changesearch(changeid);
    $("radio_" + changeid).checked = true;
}
;function qhshow(a) {
    timer = setTimeout("newsh(" + a + ")", 500)
};function newsh(b) {
    for (var a = 1; a <= 7; a++) {
        if (b != a) {
            if (!$("s1" + a)) {
                continue
            }
            rmClass($("s1" + a), "cur_main");
            hide($("s_s1" + a))
        } else {
            addClass($("s1" + a), "cur_main");
            show($("s_s1" + a))
        }
    }
    var dharr = new Array('', '', 'indextb', 'allsoft', 'i', 'indexyx', 'yinyue', 'caipiao_s');
    for (var i = 2; i < 8; i++) {
        if (i == b && $('s_s1' + i).innerHTML == '') {
            if (i == 4)$('s_s1' + b).innerHTML = '<iframe class="idfrm" SCROLLING="no" FRAMEBORDER="0" src="http://i.5w.com/data/html/i.htm"></iframe>'; else $('s_s1' + b).innerHTML = '<iframe class="idfrm" SCROLLING="no" FRAMEBORDER="0" src="http://www.5w.com/data/html/' + dharr[i] + '.htm"></iframe>';
        }
    }
};function getCookie(a) {
    var b = a + "=";
    var c = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.lastIndexOf(b);
        if (offset != -1) {
            offset += b.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length
            }
            c = unescape(document.cookie.substring(offset, end))
        }
    }
    return c
};function SetCookie(c, e, a, f, d) {
    var b = new Date();
    b.setTime(b.getTime() + 9999900000);
    a = b.toGMTString();
    f = "/";
    d = ".5w.com";
    document.cookie = c + "=" + escape(e) + (";expires=" + a) + (";path=" + f) + (";domain=" + d) + ";"
};function toolChange(c) {
    var u = new Array('http://www.5w.com/data/html/youxi.htm?0507', 'http://www.5w.com/data/html/jipiao.htm?0507', 'http://www.5w.com/data/html/jiudian.htm?0507');
    var b = 4;
    for (var a = 1; a <= b; a++) {
        $("tool-tab" + a).className = '';
        hide($("tb" + a));
        if (a >= 2 && $('tb' + a).innerHTML == '')$('tb' + a).innerHTML = '<iframe width="217" SCROLLING="no" FRAMEBORDER="0" src="' + u[a - 2] + '" allowtransparency="true" style="background-color=transparent"></iframe>';
    }
    $("tool-tab" + c).className = "active";
    show($("tb" + c))
};function setHomePage(c, d) {
    if (d == "http://www.5w.com/") {
        var l_url = document.location.href;
        var tjpos = l_url.indexOf("doudou_");
        if (tjpos != -1) {
            d = l_url;
        }
    }
    if (document.all) {
        document.body.style.behavior = "url(#default#homepage)";
        document.body.setHomePage(d)
    } else {
        if (window.sidebar) {
            if (window.netscape) {
                try {
                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
                } catch (b) {
                    alert("\u60a8\u7684firefox\u5b89\u5168\u9650\u5236\u9650\u5236\u60a8\u8fdb\u884c\u526a\u8d34\u677f\u64cd\u4f5c\uff0c\u8bf7\u5728\u6d4f\u89c8\u5668\u5730\u5740\u680f\u8f93\u5165\u2019about:config\u2019\u5e76\u56de\u8f66\uff0c\u7136\u540e\u5c06\u2019signed.applets.codebase_principal_support\u2019\u8bbe\u7f6e\u4e3a\u2019true\u2019\u4e4b\u540e\u91cd\u8bd5\u3002");
                    return
                }
            }
            var a = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
            a.setCharPref("browser.startup.homepage", d)
        }
    }
};function gotosearch() {
    var of = document.f;
    if (of.backurl != undefined) {
        var re;
        re = /{key}/g;
        var keys = of.key.value;
        var url = of.backurl.value;
        of.backurl.value = url.replace(re, keys);
    }
    return true;
}
var taobaof = '';
function change(f) {
    if (null == $("kw"))key = $("q").value; else key = $("kw").value;
    var o = $('s_ul').childNodes;
    for (var i = 0; i < o.length; i++)if (o[i].nodeType == 1)rmClass(o[i], "cur");
    addClass($("so_" + f), "cur");
    if (scache[f] != undefined) {
        $("sform").innerHTML = scache[f];
        getfocus(key, (taobaof == f) ? 'q' : 'kw');
    } else {
        acLoadJS("http://www.5w123.com/cache/js/s_" + f + ".js?c=" + Math.random(), '');
    }
};
function changesearch(id) {
    SetCookie("changeid", id);
    bkey = $("b_kw").value;
    if (ccache[id] != undefined) {
        $("search_bottom").innerHTML = ccache[id];
        bgetfocus(bkey);
    } else {
        acLoadJS("http://www.5w123.com/cache/js/b_" + id + ".js?c=" + Math.random(), '');
    }
};function bgetfocus(key) {
    $("b_kw").focus();
    $("b_kw").value = key;
};function getfocus(key, q) {
    if (null == $(q))return;
    $(q).focus();
    $(q).value = key;
    if (q == 'kw')t = 'baidu'; else t = 'taobao';
    ac = new AC(q, 'auto', t)
};function C(o) {
    return document.createElement(o)
};function Ci(_, A) {
    var o = C("input");
    o.name = _;
    o.value = A;
    o.type = "hidden";
    return o
};function trim(o) {
    o = o.replace(/(^\u3000+)|(\u3000+o)/g, "");
    o = o.replace(/(^ +)|( +o)/g, "");
    return o
}
var format = function (_, B) {
    if (arguments.length > 1) {
        var F = format, H = /([.*+?^=!:${}()|[\]\/\\])/g, C = (F.left_delimiter || "{").replace(H, "\\$1"), A = (F.right_delimiter || "}").replace(H, "\\$1"), E = F._r1 || (F._r1 = new RegExp("#" + C + "([^" + C + A + "]+)" + A, "g")), G = F._r2 || (F._r2 = new RegExp("#" + C + "(\\d+)" + A, "g"));
        if (typeof(B) == "object")return _.replace(E, function (_, A) {
            var o = B[A];
            if (typeof o == "function")o = $(A);
            return typeof(o) == "undefined" ? "" : o
        }); else if (typeof(B) != "undefined") {
            var D = Array.prototype.slice.call(arguments, 1), o = D.length;
            return _.replace(G, function (A, _) {
                _ = parseInt(_, 10);
                return (_ >= o) ? A : D[_]
            })
        }
    }
    return _
};
var Config = {
    MailConfig: [{val: 0}, {
        action: "http://www.5w123.com/getdata.php?act=mail163",
        params: {
            url: "http://reg.163.com/login.jsp?type=1&url=http://entry.mail.163.com/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&",
            username: "#{u}",
            password: "#{p}"
        }
    }, {
        action: "http://www.5w123.com/getdata.php?act=mail126",
        params: {
            domain: "126.com",
            username: "#{u}@126.com",
            password: "#{p}",
            url: "http://reg.163.com/login.jsp?type=1&product=mail126&url=http://entry.mail.126.com/cgi/ntesdoor?hid=10010102&lightweight=1&"
        }
    }, {
        action: "https://passport.baidu.com/?login",
        params: {u: "http://passport.baidu.com/center", username: "#{u}", password: "#{p}"}
    }, {
        action: "http://passport.renren.com/PLogin.do",
        params: {email: "#{u}", password: "#{p}", origURL: "http://www.renren.com/Home.do", domain: "renren.com"}
    }, {
        action: "http://mail.sina.com.cn/cgi-bin/login.cgi",
        params: {u: "#{u}", psw: "#{p}"}
    }, {
        action: "https://edit.bjs.yahoo.com/config/login",
        params: {login: "#{u}@yahoo.com.cn", passwd: "#{p}", domainss: "yahoo", ".intl": "cn", ".src": "ym"}
    }, {
        action: "https://edit.bjs.yahoo.com/config/login",
        params: {
            login: "#{u}@yahoo.cn",
            passwd: "#{p}",
            domainss: "yahoocn",
            ".intl": "cn",
            ".done": "http://mail.cn.yahoo.com/inset.html"
        }
    }, {
        action: "http://passport.sohu.com/login.jsp",
        params: {
            loginid: "#{u}@sohu.com",
            passwd: "#{p}",
            fl: "1",
            vr: "1|1",
            appid: "1000",
            ru: "http://login.mail.sohu.com/servlet/LoginServlet",
            ct: "1173080990",
            sg: "5082635c77272088ae7241ccdf7cf062"
        }
    }, {
        action: "http://login.mail.tom.com/cgi/login",
        params: {user: "#{u}", pass: "#{p}"}
    }, {
        action: "http://passport.21cn.com/maillogin.jsp",
        params: {UserName: "#{u}@21cn.com", passwd: "#{p}", domainname: "21cn.com"}
    }, {
        action: "http://www.5w123.com/getdata.php?act=mail163",
        params: {
            domain: "yeah.net",
            username: "#{u}@yeah.net",
            password: "#{p}",
            url: "http://entry.mail.yeah.net/cgi/ntesdoor?lightweight%3D1%26verifycookie%3D1%26style%3D-1"
        }
    }, {
        action: "http://passport.51.com/login.5p",
        params: {
            passport_51_user: "#{u}",
            passport_51_password: "#{p}",
            gourl: "http%3A%2F%2Fmy.51.com%2Fwebim%2Findex.php"
        }
    }, {
        action: "http://login.tianya.cn/user/v3_loginsubmit.asp",
        params: {vwriter: "#{u}", vpassword: "#{p}"}
    }, {
        action: "http://passport.sohu.com/login.jsp",
        params: {
            loginid: "#{u}@chinaren.com",
            passwd: "#{p}",
            fl: "1",
            vr: "1|1",
            appid: "1005",
            ru: "http://profile.chinaren.com/urs/setcookie.jsp?burl=http://alumni.chinaren.com/",
            ct: "1174378209",
            sg: "84ff7b2e1d8f3dc46c6d17bb83fe72bd"
        }
    }, {val: 0}, {action: "http://qzone.qq.com/index.html", type: "link"}, {
        action: "http://mail.qq.com",
        type: "link"
    }, {action: "http://gmail.google.com", type: "link"}, {
        action: "http://www.hotmail.com",
        type: "link"
    }, {action: "http://mail.139.com", type: "link"}, {action: "http://www.kaixin001.com", type: "link"}]
};
var MailLogin = {
    mailCache: [], sendMail: function () {
        var B = $("hao_mail_username").value, C = $("hao_mail_passwd").value, E = $("hao_mail_options"), A = document.mail, _ = E.selectedIndex, H = Config.MailConfig[_], F = {
            u: B,
            p: C
        };
        if (H.val == 0) {
            alert("\u60a8\u6ca1\u6709\u9009\u62e9\u90ae\u7bb1\uff01");
            return
        }
        if (trim(F.u) == "") {
            alert("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a\uff01");
            return
        }
        if (trim(F.p) == "") {
            alert("\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01");
            return
        }
        if (this.mailCache.index != _) {
            this.mailCache.index = _;
            for (var I = 0, D = this.mailCache.length; I < D; I++)A.removeChild(this.mailCache[I]);
            this.mailCache = []
        }
        A.action = H.action;
        for (I in H.params) {
            var o = Ci(I, format(H.params[I], F));
            this.mailCache.push(o);
            A.appendChild(o)
        }
        $("hao_mail_username").value = "";
        $("hao_mail_passwd").value = "";
        A.submit();
        $("hao_mail_username").value = B
    }, change: function (_) {
        var o = Config.MailConfig[_.selectedIndex];
        if (o.type == "link") {
            window.open(o.action);
            _.selectedIndex = 15
        }
    }
}
var mtimer = 500, avC, hS = true, dI, hidem = function () {
    if (hS && avC) {
        hide(avC)
    }
};
function mmover(el) {
    hidem();
    var box = el.parentNode.getElementsByTagName("div")[0];
    dI = window.setTimeout(function () {
        show(box)
    }, mtimer);
    avC = box;
    hS = false;
    if (!box.onmouseover) {
        box.onmouseover = function () {
            hS = false
        };
        box.onmouseout = function () {
            hS = true;
            window.setTimeout(hidem, mtimer)
        }
    }
};function mmout(n) {
    hS = true;
    window.setTimeout(hidem, mtimer);
    if (dI != undefined) {
        window.clearTimeout(dI)
    }
}
function sbackcall(json, f) {
    var r, reg, inputid;
    reg = /taobao/ig;
    r = json.def.action.match(reg);
    if (r != undefined) {
        inputid = 'q';
        taobaof = f;
    } else {
        inputid = 'kw';
    }
    ;
    var str = '';
    str += '<div id="sf"><div id="search_form"><form name="f" action="' + json.def.action + '" method="get" onsubmit="return gotosearch();">';
    str += '<p><a href="' + json.def.url + '"><img src="http://www.5w123.com/' + json.def.img_url + '" border="0"/></a>';
    str += '<input type="text" size="42" class="int" onkeyup="ac.start(event)" onmouseover="this.className=\'int_on\';this.focus();" onblur="this.className=\'int\';" autocomplete="off" name="' + json.def.name + '" id="' + inputid + '"/>';
    var i = json.i;
    for (var j = 0; j < i; j++) {
        str += '<input type="hidden" name="' + json.params[j][0] + '" value="' + json.params[j][1] + '"/>';
    }
    str += '<input type="submit" value="' + json.def.btn + '" id="bdbutton" class="searchint"></p></form></div>';
    var l = json.search.length;
    str += '</div><div id="hot_words"><ul>';
    var l = json.keywords.length;
    for (var z = 0; z < l; z++) {
        if (json.keywords[z].namecolor != '') {
            str += '<li><a href="' + json.keywords[z].url + '" style="color:' + json.keywords[z].namecolor + '">' + json.keywords[z].name + '</a></li>';
        } else {
            str += '<li><a href="' + json.keywords[z].url + '">' + json.keywords[z].name + '</a></li>';
        }
    }
    str += '</ul></div>';
    $("sform").innerHTML = str;
    scache[f] = str;
    getfocus(key, inputid);
}
function bbcall(json, id) {
    var str = '';
    str += '<form name="f" action="' + json.con.action + '" method="get" onsubmit="return gotosearch();">';
    str += '<p><a href="' + json.con.url + '"><img src="http://www.5w123.com/' + json.con.img_url + '" border="0"/></a>';
    str += '<input type="text" size="42" class="int" autocomplete="off" name="' + json.con.name + '" id="b_kw"/>';
    var i = json.i;
    for (var j = 0; j < i; j++) {
        str += '<input type="hidden" name="' + json.params[j][0] + '" value="' + json.params[j][1] + '"/>';
    }
    str += '<input type="submit" value="' + json.con.btn + '" id="bdbutton" class="btn"></p></form>';
    $("search_bottom").innerHTML = str;
    ccache[id] = str;
    bgetfocus(bkey);
}
if ($('mystylediv') != undefined) {
    var psize = getCookie('psize'), pcss = getCookie('pcss'), mybg = getCookie('mybg'), timer;
    if (psize == 'kp') {
        psize = '_wide';
        show($('t_s'));
    } else if (psize == 'index') {
        psize = '';
        hide($('t_s'));
    } else {
        if (screen.width > 1399) {
            psize = '_wide';
            show($('t_s'));
            SetCookie("psize", "kp");
        }
    }
    if (pcss == '' || pcss == 'blue')pcss = 'default';
    $('links').href = 'http://www.5w123.com/theme/5w/css/style_' + pcss + psize + '.css';
    if (mybg != '') {
        $('mystyle').style.background = mybg;
        if ($('mystyle').style.backgroundImage != 'none') {
            $('sb').className = 'searchbox_b';
            addClass($('header'), 'header_b');
        }
    }
    function my() {
        var d = $('mystylediv').style.height;
        var m = new slide('mystylediv', 500);
        if (d == '') {
            $('ifStyle').src = "mystyle.html";
            m.slideDown();
        } else {
            m.slideUp();
        }
    }

    var slide = function (id, timelen) {
        this.Objs = document.getElementById(id);
        this.Objs.style.overflow = "hidden";
        this.timelength = timelen;
        var isNone = false;
        if (this.Objs.style.display == 'none') {
            this.Objs.style.display = 'block';
            this.Objs.style.visibility = "hidden";
            isNone = true;
        }
        this.paddingTop = this.Objs.style.paddingTop;
        this.paddingBottom = this.Objs.style.paddingBottom;
        this.Objs.style.paddingTop = 0;
        this.Objs.style.paddingBottom = 0;
        this.contentheight = parseInt(this.Objs.style.height);
        if (isNaN(this.contentheight)) {
            this.contentheight = parseInt(this.Objs.offsetHeight);
        }
        if (isNone) {
            this.Objs.style.height = 0;
        } else {
            this.Objs.style.paddingTop = this.paddingTop;
            this.Objs.style.paddingBottom = this.paddingBottom;
            this.Objs.style.height = this.contentheight + 'px';
        }
    }
    slide.prototype.engine = function (direction) {
        var elapsed = new Date().getTime() - this.startTime;
        var thisobj = this;
        if (elapsed < this.timelength) {
            var distancepercent;
            if (direction == "down") {
                this.Objs.style.visibility = "visible";
                distancepercent = (1 - Math.cos(elapsed / this.timelength * Math.PI)) / 2;
            } else {
                distancepercent = 1 - (1 - Math.cos(elapsed / this.timelength * Math.PI)) / 2;
            }
            this.Objs.style.height = distancepercent * this.contentheight + "px";
            this.runtimer = setTimeout(function () {
                thisobj.engine(direction);
            }, 10);
        } else {
            if (direction == "down") {
                this.Objs.style.paddingTop = this.paddingTop;
                this.Objs.style.paddingBottom = this.paddingBottom;
                this.Objs.style.height = this.contentheight + "px";
            } else {
                this.Objs.style.visibility = "hidden";
                this.Objs.style.display = "none";
                this.Objs.style.height = "";
            }
            this.runtimer = null;
        }
    }
    slide.prototype.slideDown = function () {
        if (typeof this.runtimer == "undefined" || this.runtimer == null) {
            if (parseInt(this.Objs.style.height) == 0) {
                this.startTime = new Date().getTime();
                this.engine("down");
            }
        }
    }
    slide.prototype.slideUp = function () {
        if (typeof this.runtimer == "undefined" || this.runtimer == null) {
            if (parseInt(this.Objs.style.height) == this.contentheight) {
                this.startTime = new Date().getTime();
                this.engine("up");
            }
        }
    }
}
if ($('detail') != undefined) {
    var tflag = 1;

    function rweather(obj) {
        if (obj.value == '保存') {
            var zone = $('zone').value;
            acLoadJS('http://weather.ssl.qhimg.com/sed_api_weather_info.php?code=' + zone + '&_jsonp=getWeather');
        }
        show($('detail'));
        hide($('choose'));
    }



    function choosecity() {
        hide($('detail'));
        show($('choose'));
        if (tflag) {
            acLoadJS("http://www.5w123.com/weath5wtq.php?a=getZoneInfo&type=0");
            tflag = 0;
        }
    }

    function getcity(p) {
        acLoadJS("http://www.5w123.com/weath5wtq.php?a=getZoneInfo&type=1&pid=" + p + "&callback=getcityFun");
    }

    function getzone(p) {
        acLoadJS("http://www.5w123.com/weath5wtq.php?a=getZoneInfo&type=2&cid=" + p + "&pid=" + $('province').value + "&callback=getzoneFun");
    }

    //function getWeather(json){var str='';if(undefined!=json.weatherinfo){str +='<a style="color:#666;" href="http://tianqi.5w.com" target="_blank"><strong>'+json.weatherinfo.city+'</strong>';str += '&nbsp;&nbsp;今天&nbsp;'+json.weatherinfo.img1;str += '&nbsp;'+json.weatherinfo.temp1+'';str += '&nbsp;&nbsp;'+json.weatherinfo.weather1;str += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;明天&nbsp;'+json.weatherinfo.img3;str += '&nbsp;'+json.weatherinfo.temp2+'';str += '&nbsp;&nbsp;'+json.weatherinfo.weather2;str += '&nbsp;<a style="color:#666;cursor:pointer" onclick="choosecity()">[选择城市]</a>';if($('loca')!=undefined){if(json.weatherinfo.pro===undefined)json.weatherinfo.pro='广东';$('loca').value=json.weatherinfo.pro;}}if(str == '')str='<a style="color:#666;" href="javascript:;" onclick="rweather();">连接超时，请重新获取天气</a>';$('detail').innerHTML=str;$('kw').focus();}
    function getWeather(json) {
        var str = '';
        str += '<a style="color:#666;" href="http://www.58shiyan.com/shiyan-weather.html" target="_blank"><strong>' + json.area[2][0] + '</strong>';
        if (json.pm25 != '')str += '&nbsp;&nbsp;<a href="http://www.58shiyan.com/shiyan-weather.html"></a>';
        str += '&nbsp;&nbsp;今天&nbsp;<img align="absmiddle" src="http://p1.qhimg.com/d/_hao360/weather/' + json.weather[0].info.day[0] + '.png" style="border:0;width:24px;height:20px"\/>';
        str += '&nbsp;' + json.weather[0].info.day[2] + '℃~' + json.weather[0].info.night[2] + '℃';
        str += '&nbsp;&nbsp;' + json.weather[0].info.day[1];
        str += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;明天&nbsp;<img align="absmiddle" src="http://p1.qhimg.com/d/_hao360/weather/' + json.weather[1].info.day[0] + '.png" style="border:0;width:24px;height:20px"\/>';
        str += '&nbsp;' + json.weather[1].info.day[2] + '℃~' + json.weather[1].info.night[2] + '℃';
        str += '&nbsp;&nbsp;' + json.weather[1].info.day[1];
        str += '&nbsp;<a style="color:#666;cursor:pointer" onclick="choosecity()">[选择城市]</a>';
        if ($('loca') != undefined) {
            $('loca').value = json.area[0][0];
        }
        if (str == '')str = '<a style="color:#666;" href="javascript:;" onclick="rweather();">连接超时，请重新获取天气</a>';
        $('detail').innerHTML = str;
        $('kw').focus();
    }



    function getZoneInfo(json) {
        var str = '<select style="width:100px;" id="province" onchange="getcity(this.value)">';
        for (var key in json[1].value) {
            if (json[0].value == key)str += "<option value='" + key + "' selected>" + json[1].value[key] + "</option>"; else str += "<option value='" + key + "'>" + json[1].value[key] + "</option>";
        }
        str += '</select>';
        $('prv').innerHTML = str;
        str = '';
        str += '<select id="city" style="width:100px;" onchange="getzone(this.value)">';
        for (var key in json[2].value) {
            if (json[4].value == key)str += "<option value='" + key + "' selected>" + json[2].value[key] + "</option>"; else str += "<option value='" + key + "'>" + json[2].value[key] + "</option>";
        }
        str += '</select>';
        $('ct').innerHTML = str;
        str = '';
        str += '<select id="zone" style="width:100px;">';
        for (var key in json[3].value) {
            if (json[5].value == key)str += "<option value='" + key + "' selected>" + json[3].value[key] + "</option>"; else str += "<option value='" + key + "'>" + json[3].value[key] + "</option>";
        }
        str += '</select>';
        $('zn').innerHTML = str;
    }

    function getcityFun(json) {
        var str = '';
        for (var key in json[0].value) {
            str += "<option value='" + key + "'>" + json[0].value[key] + "</option>";
        }
        str = '<select id="city" style="width:100px;" onchange="getzone(this.value)">' + str + '</select>';
        $('ct').innerHTML = str;
        str = '';
        str += '<select id="zone" style="width:100px;">';
        for (var key in json[1].value) {
            str += "<option value='" + key + "'>" + json[1].value[key] + "</option>";
        }
        str += '</select>';
        $('zn').innerHTML = str;
    }

    function getzoneFun(json) {
        str = '';
        str += '<select id="zone" style="width:100px;">';
        for (var key in json[0].value) {
            str += "<option value='" + key + "'>" + json[0].value[key] + "</option>";
        }
        str += '</select>';
        $('zn').innerHTML = str;
    }
}
var areas = {
    '浙江': '10403',
    '上海': '10318',
    '北京': '10405',
    '广东': '10404',
    '江苏': '10319',
    '山东': '10406',
    '福建': '10408',
    '辽宁': '10412',
    '河南': '10409',
    '四川': '10407',
    '湖北': '10411',
    '天津': '10410',
    '湖南': '10418',
    '河北': '10413',
    '重庆': '10415',
    '云南': '10424',
    '新疆': '10427',
    '西藏': '10431',
    '青海': '10429',
    '宁夏': '10430',
    '内蒙古': '10423',
    '江西': '10416',
    '吉林': '10419',
    '黑龙江': '10421',
    '海南': '10426',
    '贵州': '10422',
    '广西': '10417',
    '甘肃': '10425',
    '安徽': '10414',
    '陕西': '10420',
    '山西': '10428'
};
var faceValueId = {
    '10': '7770',
    '20': '10291',
    '30': '10292',
    '50': '10109',
    '100': '7888',
    '200': '10501',
    '300': '10294',
    '500': '10434',
    '1000': '10295'
};
var areas_valueId = {
    '浙江': '30510',
    '上海': '29423',
    '北京': '29400',
    '广东': '30517',
    '江苏': '30511',
    '山东': '30501',
    '福建': '30519',
    '辽宁': '30498',
    '河南': '30500',
    '四川': '30508',
    '湖北': '30513',
    '天津': '29428',
    '湖南': '30514',
    '河北': '30499',
    '重庆': '29404',
    '云南': '84923',
    '新疆': '30506',
    '西藏': '27009',
    '青海': '30504',
    '宁夏': '30507',
    '内蒙古': '30495',
    '江西': '30512',
    '吉林': '30497',
    '黑龙江': '30496',
    '海南': '30520',
    '贵州': '30516',
    '广西': '30518',
    '甘肃': '30505',
    '安徽': '30509',
    '陕西': '30503',
    '山西': '30502'
};
var face_valueId = {
    '1': '30675',
    '10': '30676',
    '20': '30677',
    '30': '30688',
    '50': '30678',
    '100': '30679',
    '200': '30690',
    '300': '30691',
    '500': '30692',
    '1000': '38182'
};
var g_Props = new Array();
g_Props['150401'] = new Array('20780', '20779', '20789');
g_Props['150402'] = new Array('20782', '20781', '20790');
g_Props['50011814'] = new Array('1626918', '1626917', '1626919');
function preSubmit(f) {
    var cat = f.elements['cat'].value;
    if (!cat) {
        alert("请选择运营商");
        return false;
    }
    var s_location = f.elements['location'].value;
    if (!s_location) {
        alert("请选择地区");
        return false;
    }
    var reservePrice = f.elements['reserve_price'].value;
    if (!reservePrice) {
        alert("请选择面值");
        return false;
    }
    var brand = "";
    if (cat == "150401") {
        brand = "1754";
    } else if (cat == "150402") {
        brand = "1755";
    } else if (cat == "50011814") {
        brand = "8912";
    }
    f.elements['brand'].value = brand;
    var valueId = faceValueId[reservePrice];
    if (valueId == undefined) {
        valueId = -1;
    }
    f.elements['properties'].value = "10006:" + areas[s_location] + ";10002:" + valueId;
    if (cat.length > 0 && s_location.length > 0 && reservePrice.length > 0) {
    } else {
        return false;
    }
    var prop = g_Props[cat];
    var sProp = prop[0] + ':' + areas_valueId[s_location] + ';' + prop[1] + ':' + face_valueId[reservePrice];
    f.elements['prop'].value = sProp;
    return true;
}
function getTellCardDIV() {
    var oCard = null;
    var oDivs = document.body.getElementsByTagName('DIV');
    if (oDivs) {
        for (var loop = 0; loop < oDivs.length; loop++) {
            oCard = oDivs[loop];
            var sClassName = oCard.className;
            if (sClassName && sClassName.indexOf("fast-track") >= 0) {
                oCard = oDivs[loop];
                break;
            }
        }
    }
    return oCard;
};function doView() {
    var f = document.forms['newForm'];
}
var cat_reserve = new Array();
cat_reserve['150401'] = [1, 10, 20, 30, 50, 100, 200, 300, 500, 1000];
cat_reserve['150402'] = [1, 10, 20, 30, 50, 100, 133, 200, 300, 500];
cat_reserve['50011814'] = [1, 10, 20, 30, 50, 100, 200, 300, 500, 1000];
cat_reserve['150406'] = [1, 10, 20, 30, 50, 100, 200, 300, 500];
function changeCat(catDom) {
    var o_tellcard = getTellCardDIV();
    var f = document.forms['mobileAutoForm'];
    var cat = catDom.value;
    var provinceValue = f.elements['location'].value;
    var citysDom = f.elements['xlt_city'];
    var currentCity = "";
    if (citysDom && citysDom.value)currentCity = citysDom.value;
    var citysDomLi = document.getElementById('li_xlt_city');
    citysDom.options.length = 0;
    changeReserve();
};function changeReserve() {
    var f = document.forms['mobileAutoForm'];
    var cat = f.elements['cat'].value;
    var r = f.elements['reserve_price'];
    var or = r.value;
    var resetReserve = false;
    r.length = 0;
    for (var i = 0; i < cat_reserve[cat].length; i++) {
        r.options[i] = new Option(cat_reserve[cat][i] + '元', cat_reserve[cat][i]);
        if (cat_reserve[cat][i] == or)resetReserve = true;
    }
    if (resetReserve)r.value = or;
};function changeProvince(prop) {
    var o_tellcard = getTellCardDIV();
    var propvalue = prop.value;
    var f = document.forms['mobileAutoForm'];
    var cat = f.elements['cat'].value;
    var citysDom = f.elements['xlt_city'];
    var citysDomLi = document.getElementById('li_xlt_city');
    citysDom.options.length = 0;
    citysDomLi.style.display = 'none';
}
if ($("date") != undefined) {
    var Calendar = (function () {
        var g = [19416, 19168, 42352, 21717, 53856, 55632, 91476, 22176, 39632, 21970, 19168, 42422, 42192, 53840, 119381, 46400, 54944, 44450, 38320, 84343, 18800, 42160, 46261, 27216, 27968, 109396, 11104, 38256, 21234, 18800, 25958, 54432, 59984, 28309, 23248, 11104, 100067, 37600, 116951, 51536, 54432, 120998, 46416, 22176, 107956, 9680, 37584, 53938, 43344, 46423, 27808, 46416, 86869, 19872, 42416, 83315, 21168, 43432, 59728, 27296, 44710, 43856, 19296, 43748, 42352, 21088, 62051, 55632, 23383, 22176, 38608, 19925, 19152, 42192, 54484, 53840, 54616, 46400, 46752, 103846, 38320, 18864, 43380, 42160, 45690, 27216, 27968, 44870, 43872, 38256, 19189, 18800, 25776, 29859, 59984, 27480, 21952, 43872, 38613, 37600, 51552, 55636, 54432, 55888, 30034, 22176, 43959, 9680, 37584, 51893, 43344, 46240, 47780, 44368, 21977, 19360, 42416, 86390, 21168, 43312, 31060, 27296, 44368, 23378, 19296, 42726, 42208, 53856, 60005, 54576, 23200, 30371, 38608, 19415, 19152, 42192, 118966, 53840, 54560, 56645, 46496, 22224, 21938, 18864, 42359, 42160, 43600, 111189, 27936, 44448, 84835];
        var p = new Array("甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸");
        var q = new Array("子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥");
        var b = new Date();
        var min = b.getMinutes();
        if (min < 10) {
            min = '0' + min;
        }
        var e = b.getFullYear();
        var i = b.getMonth();
        var m = b.getDate();

        function format(g, c) {
            if (arguments.length > 1) {
                var i = format, f = /([.*+?^=!:${}()|[\]\/\\])/g, b = (i.left_delimiter || "{").replace(f, "\\$1"), d = (i.right_delimiter || "}").replace(f, "\\$1"), j = i._r1 || (i._r1 = new RegExp("#" + b + "([^" + b + d + "]+)" + d, "g")), h = i._r2 || (i._r2 = new RegExp("#" + b + "(\\d+)" + d, "g"));
                if (typeof(c) == "object") {
                    return g.replace(j, function (l, k) {
                        var m = c[k];
                        if (typeof m == "function") {
                            m = m(k)
                        }
                        return typeof(m) == "undefined" ? "" : m
                    })
                } else {
                    if (typeof(c) != "undefined") {
                        var a = Array.prototype.slice.call(arguments, 1), e = a.length;
                        return g.replace(h, function (k, l) {
                            l = parseInt(l, 10);
                            return (l >= e) ? k : a[l]
                        })
                    }
                }
            }
            return g
        }

        function r(s) {
            return (p[s % 10] + q[s % 12])
        }

        function h(u) {
            var s, t = 348;
            for (s = 32768; s > 8; s >>= 1) {
                t += (g[u - 1900] & s) ? 1 : 0
            }
            return (t + f(u))
        }

        function f(s) {
            if (a(s)) {
                return ((g[s - 1900] & 65536) ? 30 : 29)
            } else {
                return (0)
            }
        }

        function a(s) {
            return (g[s - 1900] & 15)
        }

        function j(t, s) {
            return (g[t - 1900] & (65536 >> s)) ? 30 : 29
        }

        function k(w) {
            var u, t = 0, s = 0;
            var v = new Date(1900, 0, 31);
            var x = (w - v) / 86400000;
            this.dayCyl = x + 40;
            this.monCyl = 14;
            for (u = 1900; u < 2050 && x > 0; u++) {
                s = h(u);
                x -= s;
                this.monCyl += 12
            }
            if (x < 0) {
                x += s;
                u--;
                this.monCyl -= 12
            }
            this.year = u;
            this.yearCyl = u - 1864;
            t = a(u);
            this.isLeap = false;
            for (u = 1; u < 13 && x > 0; u++) {
                if (t > 0 && u == (t + 1) && this.isLeap == false) {
                    --u;
                    this.isLeap = true;
                    s = f(this.year)
                } else {
                    s = j(this.year, u)
                }
                if (this.isLeap == true && u == (t + 1)) {
                    this.isLeap = false
                }
                x -= s;
                if (this.isLeap == false) {
                    this.monCyl++
                }
            }
            if (x == 0 && t > 0 && u == t + 1) {
                if (this.isLeap) {
                    this.isLeap = false
                } else {
                    this.isLeap = true;
                    --u;
                    --this.monCyl
                }
            }
            if (x < 0) {
                x += s;
                --u;
                --this.monCyl
            }
            this.month = u;
            this.day = x + 1
        }

        function l(t, x) {
            var r = "日一二三四五六";
            var v = ["日", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"];
            var u = ["初", "十", "廿", "卅"];
            var w;
            if (t > 10) {
                w = "十" + v[t - 10]
            } else {
                w = v[t]
            }
            if (w == "一") {
                w = "正"
            }
            w += "月";
            switch (x) {
                case 10:
                    w += "初十";
                    break;
                case 20:
                    w += "二十";
                    break;
                case 30:
                    w += "三十";
                    break;
                default:
                    w += u[Math.floor(x / 10)];
                    w += v[parseInt(x % 10)]
            }
            w += ' 星期' + r.charAt(b.getDay());
            return (w)
        }

        function n() {
            var t = new k(new Date(e, i, m));
            var s = l(t.month, t.day);
            return (s)
        }

        function d() {
            var t = '<a href="http://rili.5w.com/" rel="nr" target="_blank" title="点击查看万年历">#{YY}年#{MM}月#{DD}日 <label id="t_hm">#{week}</label></a>';
            var s = format(t, {YY: e, MM: i + 1, DD: m, week: b.getHours() + ':' + b.getMinutes()});
            return s
        }

        function c() {
            m = m + 1;
            var s = i < 9 ? ("0" + (i + 1)) : i + 1;
            var t = m + 1 < 10 ? ("0" + m) : m;
            return (e + "-" + s + "-" + t)
        }

        function o() {
            var s = '<a href="http://rili.5w.com/" target="_blank" rel="nr" title="点击查看万年历">农历 ' + n() + "</a>";
            return s
        }

        return {day: d, cnday: o, date: c}
    })();

    function t_hm_fun() {
        clearTimeout(t_hm_timer);
        var d = new Date();
        var min = d.getMinutes();
        if (min < 10) {
            min = '0' + min;
        }
        $('t_hm').innerHTML = d.getHours() + ':' + min;
        t_hm_timer = setTimeout("t_hm_fun()", 3000);
    }

    var t_hm_timer = setTimeout("t_hm_fun()", 3000);
    $("date").innerHTML = Calendar.day();
    $("lcal").innerHTML = Calendar.cnday();
}
function lazyload() {
    var dcity = getCookie("dcity");
    acLoadJS('http://weather.ssl.qhimg.com/sed_api_weather_info.php?code=' + dcity + '&_jsonp=getWeather');
    var location_url = document.location.href;
    var tjpos = location_url.indexOf("/?");
    if (tjpos != -1) {
        var urls = location_url.split("/?");
        var d = urls[1];
        if (d != '') {
            var pos = d.indexOf("="), l = d.length;
            if (pos == -1 && l > 1 && l < 21) {
                acLoadJS("http://www.5w123.com/c.js?t=" + Math.random(), "gbk");
            }
        }
    }
}
var bi = 0, bt = 3, px = '', psize = getCookie('psize');
if (psize == 'kp') {
    var ps = 1026;
} else {
    var ps = 914;
}
function bpre() {
    rmClass($('data_i' + bi), 'btn-selected');
    if (bi == 0) {
        bi = bt;
        px = bi * ps;
    } else {
        bi = bi - 1;
        px = bi * ps
    }
    $('bh').style.margin = '0 0 0 -' + px + 'px';
    addClass($('data_i' + bi), 'btn-selected')
}
function bnext() {
    rmClass($('data_i' + bi), 'btn-selected');
    if (bi == bt) {
        bi = 0;
        px = bi * ps;
    } else {
        bi = bi + 1;
        px = bi * ps
    }
    $('bh').style.margin = '0 0 0 -' + px + 'px';
    addClass($('data_i' + bi), 'btn-selected')
}
function bnow(i) {
    rmClass($('data_i' + bi), 'btn-selected');
    px = i * ps;
    bi = i;
    $('bh').style.margin = '0 0 0 -' + px + 'px';
    addClass($('data_i' + i), 'btn-selected')
}
function glevel(v) {
    var r = 3;
    if (v >= 0 && v <= 50) {
        r = 1;
    } else if (v > 50 && v <= 100) {
        r = 2;
    } else if (v > 100 && v <= 150) {
        r = 3;
    } else if (v > 150 && v <= 200) {
        r = 4;
    } else if (v > 200 && v <= 300) {
        r = 5;
    } else if (v > 300) {
        r = 6;
    }
    return r;
}


acLoadJS('http://weather.ssl.qhimg.com/sed_api_weather_info.php?code=101201101&_jsonp=getWeather');